home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
program
/
ezmouse2.zip
/
EZMOUSE.DOC
next >
Wrap
Text File
|
1996-06-20
|
11KB
|
236 lines
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
* DOCUMENTATION FOR EZ-MOUSE 2.0 *
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
EZ-Mouse Ver 2.0: Copyright (c) 1996, by Jeff Weinstein.
All rights reserved.
Table Of Contents...............................
Introduction....................1
What's New......................2
List Of Variables...............3
List Of Procedures..............4
Where To Find Cusor Editors.....5
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-1-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
EZ-Mouse is a small unit file for Turbo Pascal 7.0 users, in need
of some mouse routines. I wrote this little utility out of my own need, and
then I decided to release it as shareware. I tried to make all the procedures
and variables as easy to understand as possible; no sense in making
programming any more difficult. Basically, EZ-Mouse is a set of 11 mouse
routines, which work in text/graphics mode.
See below for full details on the variables and procedures.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
What's new in Version 2.0? A couple of things. The biggest thing is the
addition of 2 new procedures, ResetMouse, and ChangeCursor. ResetMouse
does just what you think: resets the mouse back to normal. So, if you have
just confined the mouse to a window, or changed the cursor, this procedure
puts things back the way they were before. The ChangeCursor procedure is
also self-explanitory. It creates a new mouse cursor on the screen (only in
graphics mode). You will need the aid of a mouse cursor design program that
can save in .PAS format. I'll include a list and where to get them at the
end of this document. Lastly, I changed the ConfineMouse procedure to make
things a bit easier, see below.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-3-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Here's a list of constants and variables and a description
of their functions. You don't need to declare any of these variables in your
programs, they are already in the .TPU file. In other words, you can use
these variables as is, no need to declare anything.
CONSTANTS:
**LEFT_BUTTON = 0;
**RIGHT_BUTTON = 1;
What is this stuff you ask? In a couple of the procedures you are required
to pass an integer telling it which mouse button you want info
on. Instead of calling a procedure and passing, say 0, for the left mouse
button, you just call the procedure with LEFT_BUTTON. No big reason for this,
just makes things a little easier.
VARIABLES:
**MouseInstalled : Integer;
This is an integer variable that equals 0 if the mouse is not installed, and
-1 if it is installed. This variable is set after a call to the InstallMouse
procedure.
**NumberOfButtons : Integer;
This variable holds the number of buttons that are on the mouse. It is set
after a call to InstallMouse.
**MouseX, MouseY : Integer;
These variables hold the mouse's (X,Y) position. When you make a call to
MouseXY, it sets MouseX and MouseY to wherever the mouse is. I.E., if the
mouse is at (50,70) when you make the call to MouseXY, then MouseX and MouseY
equal 50 and 70, respectively.
**LeftPressed, RightPressed : Integer;
These variables equal -1 each if the mouse button is being held down when
the call to ButtonPress is made, 0 if the button is up.
**ButtonX, ButtonY : Integer;
When you call the ButtonClick routine, it returns where the last mouse click
was in the above variables.
**MouseMajor, MouseMinor : Byte;
When you call the MouseInfo routine, it gets the mouse version number.
The major number is store in MouseMajor, the minor in MouseMinor. Don't
worry about the fact that they're bytes, you can use these variables just as
if they were integers. In the number 6.2, 6 is the major version and 2 is
the minor version.
**MouseType : EMouseType;
This is an enumeration (big word :). After a call to MouseInfo, the procedure
returns what type of mouse it is. The mouse can be either one of these types:
BUS mouse (this value is 1); SERIAL mouse (this value is 2); INPORT mouse
(this value is 3); PS2 (this value is 4); Hewlette Packard mouse (HP, value
is 4). What's up with the enumeration stuff? Well, in your code, instead
of writing: IF MouseType=4 THEN....., you just write:
IF MouseType=PS2 THEN...., makes things a bit easier.
**MouseIRQ : Byte;
Tells you what IRQ the mouse is on. Simple as that.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-4-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Here's a list of procedures, followed by their descriptions:
PROCEDURES:
**InstallMouse;
This is called only once in your program, if you do it more the mouse acts
funky. This procedures initializes all the mouse data, etc. You won't
see the mouse, however, until you make a call to the procedure below:
**ShowMouse;
This does just what it says. It makes the mouse visible on the screen.
**HideMouse;
Another self-explanatory procedure. If the mouse is visible, it won't be
after a call to this routine.
**MouseXY;
This retrieves the (X,Y) coordinates of the mouse. This value is the same
regardless of what video mode you're in. The value of X will be between
0 and 639, and the value of Y will be between 0 and 199. The coordinates are
stored in the variables MouseX, and MouseY.
**ButtonPress;
This procedure determines if a mouse button or buttons is/are being held
down during a call to this procedure. If the left button is being pressed,
then the variable LeftPressed=-1, if the right is pressed then RightPressed=-1
if neither are pressed, then they both equal 0.
**SetMouseXY( X, Y : Integer);
This routine moves the mouse cursor to the (X,Y) coordinates that you
specify. Again, the value for X must be between 0-639, and Y must be from
0-199.
**ButtonClick( Button : Integer);
When you call this procedure, you must specify for what button you want
info on. For the left button, call the function like this:
ButtonClick(LEFT_BUTTON);
for the right button, call it: ButtonClick(RIGHT_BUTTON);
This procedure returns the coordinates of the last mouse click (for whatever
button you specified) in variables ButtonX, and ButtonY.
**ConfineMouse( MinX, MinY, MaxX, MaxY : Integer);
NOTE THE ABOVE DIFFERENCE FROM VER. 1.0!!!!!!
In Version 1.0, ConfineMouse was called like this:
ConfineMouse(MinX, MaxX, MinY, MaxY : Integer);
I decided to change it so that you passed coordinates. It just seems more
natural to call it that way.
This procedure makes it so that the mouse can only move in the rectangular
box that you specify. MinX is the lowest X coordinate the mouse can move to,
MaxX is the highest, MinY is the lowest Y coordinate, and MaxY is the highest.
For example, to confine the mouse to the rectangular region between
X coordinates 0-100, and Y coordinates 0-150, do the following:
ConfineMouse( 0, 0, 100, 150);
NOTE THE DIFFERENCE (ONCE AGAIN) IN THE EXAMPLE FROM VER. 1.0!
**NormalConfine;
This just makes it so that the mouse can move anywhere on the screen; the
way it normally is when you first call InstallMouse. Use this when you
don't want the mouse confined to that region you set using ConfineMouse.
**MouseInfo;
This last routine returns the following: The major mouse version number
in MouseMajor; the minor version number in MouseMinor; what type of mouse it
is in MouseType (see part 2 for details on this variable); and what IRQ the
mouse is on in MouseIRQ. In the number 6.02, 6 is the major version number,
and 02 is the minor version number.
**ResetMouse;
This does just what it says. If you've been mucking aroun